package com.yangjun.controller.report;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yangjun.service.report.ProductInfoReprotExportService;
import com.yangjun.vo.report.ProductInfoReportExportVO;

@RestController
@RequestMapping(value="/excel/product")
public class ProductInfoReprotExportController {

	
	@Autowired
	private ProductInfoReprotExportService productInfoReprotExportService;
	
	@ResponseBody
	@RequestMapping("/getDeminsion")
	public Object getDeminsion(@RequestParam(value="reportid")String reportid,@RequestParam(value="userid")String userid){
		return  productInfoReprotExportService.getDeminsion(reportid,userid);
	}
	@ResponseBody
	@RequestMapping("/getType2")
	public Object getType2(@RequestParam(value="type1") String[] type1,@RequestParam(value="reportid")String reportid){
		return productInfoReprotExportService.getType2(type1,reportid);
	}
	@ResponseBody
	@RequestMapping("/queryDataByReportId")
	public Object queryDataByReportid(@RequestParam(value="reportid")String reportid){
		return productInfoReprotExportService.queryData(reportid);
	}
	@ResponseBody
	@RequestMapping("/queryData")
	public Object queryData(ProductInfoReportExportVO pireVo){
		return productInfoReprotExportService.queryData(pireVo);
	}
	@ResponseBody
	@RequestMapping("/addReport")
	public Object addReport(ProductInfoReportExportVO pireVo){
		return productInfoReprotExportService.addOrUpdateReport(pireVo);
	}
	
	@ResponseBody
	@RequestMapping("/addDownloadTaskByReportId")
	public Object addDownloadTaskByReportId(@RequestParam(value="reportid")String reportid,HttpServletRequest request){
		return productInfoReprotExportService.addDownloadTask(reportid,request);
	}	
	
	@ResponseBody
	@RequestMapping("/addDownloadTask")
	public Object addDownloadTask(ProductInfoReportExportVO pireVo,HttpServletRequest request){
		return productInfoReprotExportService.addDownloadTask(pireVo,request); 
	}
	
}
